import { ref, computed } from "vue";

const loadingCount = ref(0);
export const loading = computed({
  get() {
    return loadingCount.value > 0;
  },
  set(val) {
    loadingCount.value += val ? 1 : -1;
    loadingCount.value = Math.max(0, loadingCount.value);
  },
});
